# the minimum version of CMake.
cmake_minimum_required(VERSION 3.4.1)
project(encoding)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/api/svc)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/console/common/inc)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/encoder/core/inc)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/processing/interface)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common/inc)

add_library(encoding
            SHARED
            ${CMAKE_CURRENT_SOURCE_DIR}/encoding/welsenc.cpp
            read_config.cpp
            ${CMAKE_CURRENT_SOURCE_DIR}/encoding/myjni.cpp)

add_library(libopenh264 STATIC IMPORTED)
set_target_properties(libopenh264
                       PROPERTIES IMPORTED_LOCATION
                                           ${CMAKE_CURRENT_SOURCE_DIR}/lib/arm64-v8a/libopenh264.so)

target_link_libraries(encoding libopenh264 hilog_ndk.z)

project(decoding)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/api/svc)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/console/dec/inc)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/console/common/inc)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common/inc)

add_library(decoding
            SHARED
            ${CMAKE_CURRENT_SOURCE_DIR}/decoding/h264dec.cpp
            ${CMAKE_CURRENT_SOURCE_DIR}/decoding/d3d9_utils.cpp
            read_config.cpp
            ${CMAKE_CURRENT_SOURCE_DIR}/decoding/myjni.cpp)

target_link_libraries(decoding libopenh264 hilog_ndk.z)